package expansion.recursion;
//    使用递归求累加和

public class SumRecursion {
    public static void main(String[] args) {
        int i = sumRecursion(100);
        System.out.println(i);
    }

    static int sumRecursion(int n){
        int sum = 0;
        if (n==1){
            return 1;
        }
        sum = n+sumRecursion(n-1);
        return sum;
    }
}
